package com.qiaodata;

import java.io.*;
import java.lang.management.ManagementFactory;
import java.text.ParseException;

import com.qiaodata.datatrans.transfor.OutDataToFormat;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import springfox.documentation.swagger2.annotations.EnableSwagger2;

@SpringBootApplication
@EnableSwagger2
public class Main {

	//项目启动
	public static void main(String[] args) throws IOException, ParseException {
		//pid 方便 用kill关闭
		String name = ManagementFactory.getRuntimeMXBean().getName().split("@")[0];
		FileWriter writer = new FileWriter(new File("main.pid"));
		writer.write(name);
		writer.close();
		
		SpringApplication.run(Main.class);

//		//启动加载数据
//		OutDataToFormat outDataToFormat = new OutDataToFormat();
//		outDataToFormat.readTxtToMap("/root/resource");
////		outDataToFormat.readTxtToMap("D:/data/resource");

//		//测试Java读linux系统
//		try{
//			Process process=Runtime.getRuntime().exec("ls ./");
//			InputStreamReader reader = new InputStreamReader(process.getInputStream());
//			LineNumberReader line = new LineNumberReader(reader);
//			String str;
//			while((str=line.readLine())!=null){
//				System.out.println(str);
//			}
//
//		}catch (Exception e){
//			e.printStackTrace();
//		}
//
//		System.out.println("done !!!");

	}


}
